#include<stdio.h>
/*删除有序数组重复项*/
 int removeDuplicates(int* nums, int numsSize) {
    int pos=1;
    for(int j=1;j<numsSize;j++)
    {
        if(nums[j]!=nums[j-1])
        {
            nums[pos++]=nums[j];
        }
    }
    return pos;

    
}
int main()
{
    
    int nums[]={0,0,1,1,1,2,2,3,3,4};
    int n=removeDuplicates(nums,sizeof(nums)/sizeof(nums[0]));
    for(int idx=0;idx<n;idx++)
    {
        printf("%d ",nums[idx]);
    }



    return 0;
}